<template>
  <div class="home">
    {{banner}}
  </div>
</template>

<script>
import { ref, onMounted } from 'vue'
import { getHomeAllData, getBanner } from 'network/home.js'

export default {
  name: 'Home',
  setup() {
    const banner = ref([])
    
    /*模板编译完成后执行*/
    onMounted(async ()=>{
      // 调用 home 的请求接口，获取首页数据
      const data = await getHomeAllData()
      banner.value = data.slides // 
      console.log(data);
    })



    return {
      banner
    }
  },

  components: {
  }
}
</script>
<style lang='scss'>
.demo {
  color: var(--color-high-text);
}
</style>
